package com.hitsoysauce.servlet;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.Enumeration;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;


public class ShowResultServlet extends HttpServlet {

	private static final long serialVersionUID = -2922143739743886129L;
	
	@Override
	protected void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		response.setContentType("text/html");
		
		
		HttpSession session = request.getSession();
		
		session.setAttribute("accessCount", session.getAttribute("accessCount") == null ? 1 : (Integer)session.getAttribute("accessCount")+ 1);
		request.getRequestDispatcher("/result.jsp").forward(request, response);
	}

	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		doGet(req, resp);
	}

	@Override
	public void destroy() {
		super.destroy();
	}

	@Override
	public void init() throws ServletException {
		super.init();
		
	}

	@Override
	public void init(ServletConfig config) throws ServletException {
		super.init(config);
	}

}
